﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Cspl.Calculator.Library;
using Cspl.Calculator.Library.Model;

namespace Cspl.Calculator.Main
{
    public class Program
    {
        public static void Main(string[] args)
        {
            MainCalculator calculator = new MainCalculator();
            //CalModel data1 = new CalModel() { IntegerValue1 = 20, IntegerValue2 = 0, Operation = CalOperations.Add };        
            CalModel data2 = new CalModel(CalOperations.Div);

           
            //data1.Operation = CalOperations.Div;


            CalModel data1 = new CalModel();
            data1.ListOfIntegerValue = new List<int> { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 };
            data1.IntegerValue1 = 20;
            data1.IntegerValue2 = 0;
            data1.CalMode = CalMode.single;
            data1.Operation = CalOperations.Add;            
            calculator.Data = data1;

            try
            {
                int result = calculator.Calculate();
                Console.WriteLine("result : " + result);
            }
            catch (Exception e)
            {
                Console.WriteLine("An execption occurred : " + e.Message);
            }
            


            
            Console.ReadKey();
        }
    }
}
